package com.kingsoft.dc.khaos.module.spark.preprocess.transform

import com.kingsoft.dc.khaos.KhaosContext
import com.kingsoft.dc.khaos.metadata.Dependency
import org.apache.spark.sql.DataFrame

/**
  * Created by chengguangqing on 2019/6/24.
  */
trait TransformStrategy {

  var result:Seq[(String,DataFrame)] = Seq[(String,DataFrame)]()

  def exec(kc: KhaosContext,
           module_id: String,
           config: String,
           dependences: Seq[Dependency],
           targets:Seq[Dependency]): Any = {}

  def schema(kc: KhaosContext,
             module_id:String,
             config: String,
             dependences: Seq[Dependency]): Any = {}

  def addResult(target:Dependency,df: DataFrame):Seq[(String,DataFrame)] ={
    result = result :+ (target.targetSeq,df)
    result
  }

}
